package main

import (
	"context"
	"errors"
	store "kitexdemo/kitex_gen/store"
)

// StoreInterfaceImpl implements the last service interface defined in the IDL.
type StoreInterfaceImpl struct{}

// AddStore implements the StoreInterfaceImpl interface.
func (s *StoreInterfaceImpl) AddStore(ctx context.Context, req *store.AddStoreReq) (resp int32, err error) {
	// TODO: Your code here...
	resp = 1
	err = errors.New("you add a store")
	return
}

// Delete implements the StoreInterfaceImpl interface.
func (s *StoreInterfaceImpl) Delete(ctx context.Context, req *store.DeleteReq) (resp int32, err error) {
	// TODO: Your code here...
	resp = 1
	err = errors.New("you delete a store")
	return
}

// Update implements the StoreInterfaceImpl interface.
func (s *StoreInterfaceImpl) Update(ctx context.Context, req *store.UpdateReq) (resp int32, err error) {
	// TODO: Your code here...
	resp = 1
	err = errors.New("you update a store")
	return
}

// GetStore implements the StoreInterfaceImpl interface.
func (s *StoreInterfaceImpl) GetStore(ctx context.Context, id int32, uuid string) (resp []*store.GetStoreReq, err error) {
	// TODO: Your code here...
	resp = append(resp, &store.GetStoreReq{
		Id:             id,
		StoreName:      "storeName",
		Type:           1,
		Uuid:           uuid,
		IdentitionTime: "2021-09-23 15:04:05",
		CreateAt:       "2021-09-23 15:04:05",
	}, &store.GetStoreReq{
		Id:             id,
		StoreName:      "storeName",
		Type:           1,
		Uuid:           uuid,
		IdentitionTime: "2021-09-23 15:04:05",
		CreateAt:       "2021-09-23 15:04:05",
	})
	err = nil
	return
}
